package com.ouc.pampas;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SettingHelper
{
  @Autowired
  private Setting setting;
  @Autowired
  protected AppService appService;
  
  public App findAppByDomain(String domain)
  {
    if (this.setting.getMode() == Setting.Mode.IMPLANT) {
      return this.setting.getImplantApp();
    }
    return this.appService.findByDomain(domain);
  }
}
